package org.example.entity;
import lombok.Data;
import org.hibernate.annotations.Proxy;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

//使用JPA注解配置映射关系
@Data
@Entity
@Table(name = "t_user")
@Proxy(lazy = false)
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    private long id;

    @Column(name = "last_name", length = 50) //这是和数据表对应的一个列
    private String lastName;

    @Column(name = "email", length = 50) //这是和数据表对应的一个列
    private String email;
}